<form action="" method="post" Name="f_changepass">
<?php echo $this->formHidden("hdn_update","",null); ?>
<input type="hidden" id="hdnaction" name="hdnaction" />

	<div class="title_bg_dangky">
         <p>Thay đổi mật khẩu</p>
    </div>
    <table width="100%" class="login_form" cellpadding="0" cellspacing="0">	
		<col width="25%"><col width="75%">
		<tr  style="height: 25px;">
			<td class="normal_label_net">Mật khẩu cũ<small class="small_starmark">*</small></td>
			<td><input Name="txt_password_old" type="password" class="normal_textbox_net" message ="Chua nhap mat khau cu!" value="" optional="false"></td>					
		</tr>
		<tr style="height: 25px;">
			<td class="normal_label_net" >Mật khẩu mới<small class="small_starmark">*</small></td>
			<td><input Name="txt_password_new" type="password" value="" minlength="6" message = "Mat khau phai co it nhat 6 ky tu"  optional="false"></td>
		</tr>
		<tr style="height: 25px;">
			<td class="normal_label_net" >Nhập lại mật khẩu<small class="small_starmark">*</small></td>
			<td><input Name="txt_repassword_new" type="password" value="" class="normal_textbox_net" message = "Chua nhac lai mat khau"  optional="false"></td>
		</tr>
		<tr style="height: 25px;">
			<td class="normal_label_net" >Nhập mã xác nhận <small class="small_starmark">*</small></td>
			<td><input Name="txt_registex" type="text" value="" onKeyDown="change_focus_on_firefox(document.forms['f_changepass'],this,event)" class="normal_textbox_net" message = "Hay nhap ma xac nhan!" ></td>
		</tr>
        <tr style="height: 44px;">
			<td class="normal_label_net" valign="center">Mã xác nhận</td>
			<td>
				<div id="div_captcha" style="width:80%;display: inline;"></div>
				<span class="refresh-captcha" onclick="getcaptcha();" style="cursor: pointer;"></span>
			</td>
		</tr>
		<tr style="height: 50px;">
			<td></td>
			<td>
				<input type = "button" class = "add_large_button_net" value = "Đồng ý" onClick= "btn_register_update('');">
				<input type = "button" style = "margin-left:10px;" class = "add_large_button_net" value = "Quay lại" onclick="window.history.back()" >
			</td>
		</tr>
	</table>
		
</form>
<style type="text/css">
	table.login_form tr td input{
		width: 60%;
	}
	table.login_form tr td input.add_large_button_net{ width: auto;}
</style>
<script language="JavaScript">
getcaptcha();
function getcaptcha(){
	var p_url = baseUrl + '/web/user/getcaptcha/';
	$.ajax({
		url: p_url,type: 'POST',dataType: 'html',
		success: function(data){
			if(data != ''){
				$('#div_captcha').html(data);
			}
		}
	});
}
function checkcaptcha(actionName){
	var p_url = baseUrl + '/web/user/checkcaptcha/';
	var v_input = document.f_changepass.txt_registex.value;
	$.ajax({
		url: p_url,type: 'POST',dataType: 'html',
		data: '&v_input='+v_input,
		success: function(data){
			if(data != ''){
				if(data=='1'){
					$("#hdn_update").attr("value",1);
					actionUrl(actionName);				
				}else{
					alert("Mã xác nhận không đúng");	
					document.f_changepass.txt_registex.focus();
					return false;				
				}
			}
		}
	});
}
set_focus(document.forms[0]);
function btn_register_update(actionName){	
	var v_pass = document.f_changepass.txt_password_new.value;
	if (verify(document.forms["f_changepass"])){
		if(v_pass!= "" && v_pass.length < 6){
			alert("Mật khẩu phải lớn hơn hoặc bằng 6 ký tự!");	
			document.f_changepass.txt_password_new.focus();
			return false;
		}	
		if (document.forms["f_changepass"].txt_password_new.value != document.forms["f_changepass"].txt_repassword_new.value){
			alert("Mật khẩu không đúng!");			
			document.forms["f_changepass"].txt_repassword_new.value="";
			document.forms["f_changepass"].txt_repassword_new.focus(); return;
		}
		checkcaptcha(actionName);
	}
}
</script>